#!/usr/bin/env python2
import os

try:  
    import pygtk
    pygtk.require("2.0")  
except:  
    pass  
try:  
    import gtk  
except:  
    print("GTK Not Availible")
    sys.exit(1)

class Handler:
	def gtk_main_quit(self, *args):
		print "Exiting..."
		gtk.main_quit(*args)
	def on_main_show(self, *args):
		combo = self.get_object("combobox1")
		run.fill_drivelist(combo)

class osx86:
	def __init__(self):
		builder = gtk.Builder()
		builder.add_from_file("osx86_gui.glade")
		builder.connect_signals(Handler())
		window = builder.get_object("main")
		window.show_all()
	def err(self,message):
		message = gtk.MessageDialog(None, GTK_DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_ERROR, gtk.BUTTONS_CLOSE, message)
	def checkcmd(self,cmd):
		return os.system("type -P "+cmd)
	def fill_drivelist(self,combo):
		list=gtk.ListStore(str)
		if not checkcmd("udisks"):
			self.err("udisks command missing")
		list.append(["CIAO!!!!"])
		combo.set_model(list)
		cell = gtk.CellRendererText()
		combo.pack_start(cell, True)
		combo.add_attribute(cell, 'text',0)
	def main(self):
		gtk.main()
	
if __name__ == "__main__":
	run = osx86()
	run.main()